import {
  getInfoByOrderId
} from '/service/service'
Component({
  mixins: [],
  data: {
    info: {}
  },
  props: {
    id: {
      type: 'string',
      default: ''
    }
  },
  didMount() {
    this.getInfo()
  },
  didUpdate() {},
  didUnmount() {},
  methods: {
    async getInfo() {
      try {
        const res = await getInfoByOrderId({
          workOrderId: this.props.id
        })
        // console.log(res)
        const info = {
          ...res,
          cost: res.cost === null ? '无' : res.cost
        }
        this.setData({
          info
        })
      } catch (e) {
        my.alert({
          content: e
        })
        console.error(e)
      }
    }
  },
});